#  高阶函数: 函数 , 返回值 中有函数的函数
# filter --> 过滤   <<迭代器>>
#
# filter(lambda x:x>3,[1,2,3,4,5])
#
# def bigthan3(x):
#     return x > 3
#
# res = filter(lambda x:x>3,[1,2,3,4,5])
# print(res)
# print(type(res))
#
# # from collections import Iterator
# # print(isinstance(res, Iterator))
# # True
# for i in res:
#     print(i)

# dicta = {'1':'abcdefg','2':'sfds','3':'ab','4':'a'}
# resf = filter(lambda x:int(x) in range(1,3) ,dicta)
# print(resf)
# for i in resf:
#     print(i)
str1 = 'os.txt'
print(str1[-4:])
str1_format = filter(lambda x:x[-4:] ,str1)
print(list(str1_format))





